Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #159 by ensuring that vector components that are sufficiently close to zero following a reduction are set to exactly zero. This solves the issue of conversion to OpenMM, which requires that the first vector lies exactly on the x-axis and the second is exactly in the x-y plane. Non-zero values generated by our code seem to be on the order of 1e-16, so we could probably make the tolerance smaller if needed. (The OpenMM Python API uses 1e-6 as the small value.)
An alternative approach to this would be to leave the
TrinclinicBox
class untouched and simply zero the values when setting the box vectors in the Sire to OpenMM code. Let me know if you'd prefer that approach, since this issue seems to be (at present) OpenMM specific due to the way they check for reduced form.I've cancelled the CI since it's been tested locally via some problematic
somd1
inputs. Feel free to consume into one of the other PRs if you're happy.